
{extend name="common/public" /}
{block name="content"}


<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
    <div class="widget am-cf">
        <div class="widget-head am-cf">
            <div class="widget-title am-fl">会员收员审核</div>
            <div class="widget-function am-fr">
                <a href="javascript:;" class="am-icon-cog"></a>
            </div>
        </div>
        <div class="widget-body  widget-body-lg am-fr">
            <form action="{:url()}">
                <select name="status" data-am-selected="{searchBox: 2}">

                    <option value="3"  {eq name="$Request.param.status"  value="3"}selected{/eq}>全部</option>
                    <option value="0"  {eq name="$Request.param.status"  value="0"}selected{/eq}>待审核</option>
                    <option value="1"  {eq name="$Request.param.status"  value="1"}selected{/eq}>通过审核</option>
                    <option value="2"  {eq name="$Request.param.status"  value="2"}selected{/eq}>驳回审核</option>

                </select>
                <button type="submit" class="am-btn am-btn-xs am-btn-default am-btn-success"><span class="am-icon-search"></span> 确定</button>
            </form>
            <table width="100%" id="viewer"  class="am-table am-table-compact am-table-bordered tpl-table-black ">
                <thead>

                <tr>
                                            <th class="am-lg-text-center">
                                                        id                                                        </th>
                    <th class="am-lg-text-center">
                        头像</th>
                    <th class="am-lg-text-center">
                        昵称</th>
                                            <th class="am-lg-text-center">
                                                         真实姓名</th>
                                            <th class="am-lg-text-center">
                                                        身份证号</th>
                    <th class="am-lg-text-center">
                        身份证正面</th>
                    <th class="am-lg-text-center">
                        身份证反面</th>
                                            <th class="am-lg-text-center">
                                                        联系电话</th>
                                            <th class="am-lg-text-center">
                                                        申请区域</th>
                                            <th class="am-lg-text-center">
                                                        申请备注</th>
                                            <th class="am-lg-text-center">
                                                        提交时间</th>
                                            <th class="am-lg-text-center">
                                                       审核状态</th>
                                        <th>操作</th>
                </tr>
                </thead>
                <tbody>
                
                    {foreach $list as $v}
                
                <tr class="gradeX">
                    <td class='am-lg-text-center'>                                {$v.id}</td>

                    <td class='am-lg-text-center'>                    <img src="{$v.headimgurl}"  style="width: 50px;height: 50px;">            </td>
                    <td class='am-lg-text-center'>                                {$v.nickname}</td>
                        
                    <td class='am-lg-text-center'>                                {$v.true_name}</td>
                        
                    <td class='am-lg-text-center'>                                {$v.id_card}</td>
                    <td class='am-lg-text-center'>  <img src="{$v.positive}" class="tpl-table-line-img" data-original="{$v.positive}"   style="width: 50px;height: 50px;"> </td>
                    <td class='am-lg-text-center'> <img src="{$v.back}"  class="tpl-table-line-img" data-original="{$v.back}"  style="width: 50px;height: 50px;"></td>

                    <td class='am-lg-text-center'>                                {$v.phone}</td>
                        
                    <td class='am-lg-text-center'>                                {$v.region_name}</td>
                        
                    <td class='am-lg-text-center'>                                {$v.remarks}</td>
                        
                    <td class='am-lg-text-center'>                                {$v.create_time}</td>
                        
                    <td class='am-lg-text-center'>
                        {switch $v.status}
                            {case 1}
                                <div class="am-btn am-btn-success am-btn-xs">通过</div>
                            {/case}
                            {case 0}
                                <div class="am-btn am-btn-warning am-btn-xs">待审核</div>
                            {/case}
                            {case 2}
                                <div class="am-btn am-btn-danger am-btn-xs">驳回申请</div>
                            {/case}
                        {/switch}
                        </td>
                        
                                            <td>
                            
                            <div class="tpl-table-black-operation">
                                {eq name="$v.status" value="0"}
                                    <a onclick="pass({$v.id})">
                                        <i class="am-icon-user"></i> 通过
                                    </a>
                                    <a  onclick="Fail({$v.id})"  class="tpl-table-black-operation-del">
                                        <i class="am-icon-trash"></i> 驳回
                                    </a>
                                {/eq}
                                {eq name="$v.status" value="1"}
                                    <a onclick="openUrl('{:url('userOrderList',['user_id'=>$v['user_id']])}')">
                                        <i class="am-icon-eye"></i> 订单明细
                                    </a>
                                {/eq}
                                <a href="{:url('share',['user_id'=>$v['user_id']])}">
                                    <i class="am-icon-eye"></i> 推广查询
                                </a>
                            </div>
                                                
                            
                        </td>

                </tr>
                
                    {/foreach}

                </tbody>
            </table>
            
                {$list|raw}
            
        </div>
    </div>
</div>

    {/block}
    {block name="script"}
<link href="https://cdn.bootcss.com/viewerjs/1.5.0/viewer.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/viewerjs/1.5.0/viewer.js"></script>


        <script type="text/javascript">
            var viewer = new Viewer(document.getElementById('viewer'), {
                url: 'data-original'
            });
            function pass(id) {
                window.layer.confirm('确定要同意该用户成为回收员', function(){

                        $.post("{:url('checkStatus')}",{id:id,status:1},function (result) {
                            if(result.code ==0){
                                window.layer.alert('审核成功:您已经同意该申请',function () {
                                    window.location.reload();
                                })
                            }else{
                                layer.msg('审核失败');
                            }
                        })
                })
            }
            function Fail(id) {
                layer.prompt({title: '请填写驳回原因', formType: 2}, function(test, index){
                    $.post("{:url('checkStatus')}",{id:id,status:2,reason:test},function (result) {
                        if(result.code ==0){
                            window.layer.alert('审核成功:您驳回该申请',function () {
                                window.location.reload();
                            })
                        }else{
                            layer.msg('审核失败');
                        }
                    })
                });
            }

        </script>
    {/block}
    {/extend}
